﻿Imports System.Data.SqlClient

Public Class clsDiesel
    Private mintIdDiesel As Integer
    Private mintIdTanque As Integer
    Private mintNoCarga As Integer
    Private mdatFecha As Date
    Private mtimHora As DateTime
    Private mdblCuentalitros As Double
    Private mdblLitrosDisponibles As Double
    Private mdblKardex As Double
    Private mdblPrecio As Double
    Private mdblLitrosSurtidos As Double
    Private mintIdAutobus As Integer
    Private mstrNoEconomico As String
    Private mintIdRuta As Integer
    Private mstrNombreRuta As String
    Private mdblLitros As Double
    Private mdblKilometrosTotales As Double
    Private mdblKilometrosOperacion As Double
    Private mdblKilometrosMuertos As Double
    Private mdblRendimientoStandart As Double
    Private mdblRendimientoAnterior As Double
    Private mdblRendimientoDia As Double
    Private mdblSubtotal As Double
    Private mdblIVA As Double
    Private mdblTotal As Double
    Private mstrCodigoOperador As String
    Private mstrNombreOperador As String
    Private mstrCodigoDespachador As String
    Private mstrNombreDespachador As String
    Private mdblImporte01 As Double
    Private mdblImporte02 As Double
    Private mdblImporte03 As Double
    Private mdblImporte04 As Double
    Private mdblImporte05 As Double
    Private mstrTexto01 As String
    Private mstrTexto02 As String
    Private mstrTexto03 As String
    Private mstrTexto04 As String
    Private mstrTexto05 As String
    Public Property IdDiesel() As Integer
        Get
            Return mintIdDiesel
        End Get
        Set(ByVal value As Integer)
            mintIdDiesel = value
        End Set
    End Property
    Public Property IdTanque() As Integer
        Get
            Return mintIdTanque
        End Get
        Set(ByVal value As Integer)
            mintIdTanque = value
        End Set
    End Property
    Public Property NoCarga() As Integer
        Get
            Return mintNoCarga
        End Get
        Set(ByVal value As Integer)
            mintNoCarga = value
        End Set
    End Property
    Public Property Fecha As Date
        Get
            Return mdatFecha
        End Get
        Set(ByVal value As Date)
            mdatFecha = value
        End Set
    End Property
    Public Property Hora As DateTime
        Get
            Return mtimHora
        End Get
        Set(value As DateTime)
            mtimHora = value
        End Set
    End Property
    Public Property Cuentalitros() As Double
        Get
            Return mdblCuentalitros
        End Get
        Set(ByVal value As Double)
            mdblCuentalitros = value
        End Set
    End Property
    Public Property LitrosDisponibles() As Double
        Get
            Return mdblLitrosDisponibles
        End Get
        Set(ByVal value As Double)
            mdblLitrosDisponibles = value
        End Set
    End Property
    Public Property Kardex() As Double
        Get
            Return mdblKardex
        End Get
        Set(ByVal value As Double)
            mdblKardex = value
        End Set
    End Property
    Public Property Precio() As Double
        Get
            Return mdblPrecio
        End Get
        Set(value As Double)
            mdblPrecio = value
        End Set
    End Property
    Public Property LitrosSurtidos() As Double
        Get
            Return mdblLitrosSurtidos
        End Get
        Set(ByVal value As Double)
            mdblLitrosSurtidos = value
        End Set
    End Property
    Public Property IdAutobus() As Integer
        Get
            Return mintIdAutobus
        End Get
        Set(ByVal value As Integer)
            mintIdAutobus = value
        End Set
    End Property
    Public Property NoEconomico() As String
        Get
            Return mstrNoEconomico
        End Get
        Set(value As String)
            mstrNoEconomico = value
        End Set
    End Property
    Public Property IdRuta() As Integer
        Get
            Return mintIdRuta
        End Get
        Set(ByVal value As Integer)
            mintIdRuta = value
        End Set
    End Property
    Public Property NombreRuta() As String
        Get
            Return mstrNombreRuta
        End Get
        Set(value As String)
            mstrNombreRuta = value
        End Set
    End Property
    Public Property Litros() As Double
        Get
            Return mdblLitros
        End Get
        Set(ByVal value As Double)
            mdblLitros = value
        End Set
    End Property
    Public Property KilometrosTotales() As Double
        Get
            Return mdblKilometrosTotales
        End Get
        Set(ByVal value As Double)
            mdblKilometrosTotales = value
        End Set
    End Property
    Public Property KilometrosOperacion() As Double
        Get
            Return mdblKilometrosOperacion
        End Get
        Set(ByVal value As Double)
            mdblKilometrosOperacion = value
        End Set
    End Property
    Public Property KilometrosMuertos() As Double
        Get
            Return mdblKilometrosMuertos
        End Get
        Set(ByVal value As Double)
            mdblKilometrosMuertos = value
        End Set
    End Property
    Public Property RendimientoStandart() As Double
        Get
            Return mdblRendimientoStandart
        End Get
        Set(ByVal value As Double)
            mdblRendimientoStandart = value
        End Set
    End Property
    Public Property RendimientoAnterior() As Double
        Get
            Return mdblRendimientoAnterior
        End Get
        Set(ByVal value As Double)
            mdblRendimientoAnterior = value
        End Set
    End Property
    Public Property RendimientoDia() As Double
        Get
            Return mdblRendimientoDia
        End Get
        Set(ByVal value As Double)
            mdblRendimientoDia = value
        End Set
    End Property
    Public Property Subtotal() As Double
        Get
            Return mdblSubtotal
        End Get
        Set(ByVal value As Double)
            mdblSubtotal = value
        End Set
    End Property
    Public Property IVA() As Double
        Get
            Return mdblIVA
        End Get
        Set(ByVal value As Double)
            mdblIVA = value
        End Set
    End Property
    Public Property Total() As Double
        Get
            Return mdblTotal
        End Get
        Set(ByVal value As Double)
            mdblTotal = value
        End Set
    End Property
    Public Property CodigoOperador() As String
        Get
            Return mstrCodigoOperador
        End Get
        Set(value As String)
            mstrCodigoOperador = value
        End Set
    End Property
    Public Property NombreOperador() As String
        Get
            Return mstrNombreOperador
        End Get
        Set(value As String)
            mstrNombreOperador = value
        End Set
    End Property
    Public Property CodigoDespachador() As String
        Get
            Return mstrCodigoDespachador
        End Get
        Set(value As String)
            mstrCodigoDespachador = value
        End Set
    End Property
    Public Property NombreDespachador() As String
        Get
            Return mstrNombreDespachador
        End Get
        Set(value As String)
            mstrNombreDespachador = value
        End Set
    End Property
    Public Property Importe01() As Double
        Get
            Return mdblImporte01
        End Get
        Set(ByVal value As Double)
            mdblImporte01 = value
        End Set
    End Property
    Public Property Importe02() As Double
        Get
            Return mdblImporte02
        End Get
        Set(ByVal value As Double)
            mdblImporte02 = value
        End Set
    End Property
    Public Property Importe03() As Double
        Get
            Return mdblImporte03
        End Get
        Set(ByVal value As Double)
            mdblImporte03 = value
        End Set
    End Property
    Public Property Importe04() As Double
        Get
            Return mdblImporte04
        End Get
        Set(ByVal value As Double)
            mdblImporte04 = value
        End Set
    End Property
    Public Property Importe05() As Double
        Get
            Return mdblImporte05
        End Get
        Set(ByVal value As Double)
            mdblImporte05 = value
        End Set
    End Property
    Public Property Texto01 As String
        Get
            Return mstrTexto01
        End Get
        Set(value As String)
            mstrTexto01 = value
        End Set
    End Property
    Public Property Texto02 As String
        Get
            Return mstrTexto02
        End Get
        Set(value As String)
            mstrTexto02 = value
        End Set
    End Property
    Public Property Texto03 As String
        Get
            Return mstrTexto03
        End Get
        Set(value As String)
            mstrTexto03 = value
        End Set
    End Property
    Public Property Texto04 As String
        Get
            Return mstrTexto04
        End Get
        Set(value As String)
            mstrTexto04 = value
        End Set
    End Property
    Public Property Texto05 As String
        Get
            Return mstrTexto05
        End Get
        Set(value As String)
            mstrTexto05 = value
        End Set
    End Property

    Public Sub New()
        mintIdDiesel = 0
        mintIdTanque = 0
        mintNoCarga = 0
        mdatFecha = Now()
        mtimHora = Now()
        mdblCuentalitros = 0
        mdblLitrosDisponibles = 0
        mdblKardex = 0
        mdblPrecio = 0
        mdblLitrosSurtidos = 0
        mintIdAutobus = 0
        mstrNoEconomico = ""
        mintIdRuta = 0
        mstrNombreRuta = ""
        mdblLitros = 0
        mdblKilometrosTotales = 0
        mdblKilometrosOperacion = 0
        mdblKilometrosMuertos = 0
        mdblRendimientoStandart = 0
        mdblRendimientoAnterior = 0
        mdblRendimientoDia = 0
        mdblSubtotal = 0
        mdblIVA = 0
        mdblTotal = 0
        mstrCodigoOperador = ""
        mstrNombreOperador = ""
        mstrCodigoDespachador = ""
        mstrNombreDespachador = ""
        mdblImporte01 = 0
        mdblImporte02 = 0
        mdblImporte03 = 0
        mdblImporte04 = 0
        mdblImporte05 = 0
        mstrTexto01 = ""
        mstrTexto02 = ""
        mstrTexto03 = ""
        mstrTexto04 = ""
        mstrTexto05 = ""
    End Sub
    Public Sub Buscar()
        Dim cnConn As New SqlConnection
        cnConn.ConnectionString = CitraConnection

        Dim cmdBuscar As New SqlCommand
        cmdBuscar.Connection = cnConn
        cmdBuscar.CommandText = "SELECT * From Diesel " & _
        " WHERE IdDiesel=" & mintIdDiesel

        Dim rdBuscar As SqlDataReader

        cnConn.Open()
        rdBuscar = cmdBuscar.ExecuteReader

        If rdBuscar.Read() Then
            mintIdDiesel = rdBuscar("IdDiesel")
            mintIdTanque = rdBuscar("IdTanque")
            mintNoCarga = rdBuscar("NoCarga")
            mdatFecha = rdBuscar("Fecha")
            mtimHora = rdBuscar("Hora")
            mdblCuentalitros = rdBuscar("Cuentalitros")
            mdblLitrosDisponibles = rdBuscar("LitrosDisponibles")
            mdblKardex = rdBuscar("Kardex")
            mdblPrecio = rdBuscar("Precio")
            mdblLitrosSurtidos = rdBuscar("LitrosSurtidos")
            mintIdAutobus = rdBuscar("IdAutobus")
            mstrNoEconomico = rdBuscar("NoEconomico").ToString.Trim
            mintIdRuta = rdBuscar("IdRuta")
            mstrNombreRuta = rdBuscar("NombreRuta").ToString.Trim
            mdblLitros = rdBuscar("Litros")
            mdblKilometrosTotales = rdBuscar("KilometrosTotales")
            mdblKilometrosOperacion = rdBuscar("KilometrosOperacion")
            mdblKilometrosMuertos = rdBuscar("KilometrosMuertos")
            mdblRendimientoStandart = rdBuscar("RendimientoStandart")
            mdblRendimientoAnterior = rdBuscar("RendimientoAnterior")
            mdblRendimientoDia = rdBuscar("RendimientoDia")
            mdblSubtotal = rdBuscar("SubTotal")
            mdblIVA = rdBuscar("IVA")
            mdblTotal = rdBuscar("Total")
            mstrCodigoOperador = rdBuscar("CodigoOperador").ToString.Trim
            mstrNombreOperador = rdBuscar("NombreOperador").ToString.Trim
            mstrCodigoDespachador = rdBuscar("CodigoDespachador").ToString.Trim
            mstrNombreDespachador = rdBuscar("NombreDespachador").ToString.Trim
            mdblImporte01 = rdBuscar("ImporteEx01")
            mdblImporte02 = rdBuscar("ImporteEx02")
            mdblImporte03 = rdBuscar("ImporteEx03")
            mdblImporte04 = rdBuscar("ImporteEx04")
            mdblImporte05 = rdBuscar("ImporteEx05")
            mstrTexto01 = rdBuscar("TextoEx01")
            mstrTexto02 = rdBuscar("TextoEx02")
            mstrTexto03 = rdBuscar("TextoEx03")
            mstrTexto04 = rdBuscar("TextoEx04")
            mstrTexto05 = rdBuscar("TextoEx05")

        Else

            mintIdDiesel = 0
            mintIdTanque = 0
            mintNoCarga = 0
            mdatFecha = Now()
            mtimHora = Now()
            mdblCuentalitros = 0
            mdblLitrosDisponibles = 0
            mdblKardex = 0
            mdblPrecio = 0
            mdblLitrosSurtidos = 0
            mintIdAutobus = 0
            mstrNoEconomico = ""
            mintIdRuta = 0
            mstrNombreRuta = ""
            mdblLitros = 0
            mdblKilometrosTotales = 0
            mdblKilometrosOperacion = 0
            mdblKilometrosMuertos = 0
            mdblRendimientoStandart = 0
            mdblRendimientoAnterior = 0
            mdblRendimientoDia = 0
            mdblSubtotal = 0
            mdblIVA = 0
            mdblTotal = 0
            mstrCodigoOperador = ""
            mstrNombreOperador = ""
            mstrCodigoDespachador = ""
            mstrNombreDespachador = ""
            mdblImporte01 = 0
            mdblImporte02 = 0
            mdblImporte03 = 0
            mdblImporte04 = 0
            mdblImporte05 = 0
            mstrTexto01 = ""
            mstrTexto02 = ""
            mstrTexto03 = ""
            mstrTexto04 = ""
            mstrTexto05 = ""
        End If

        rdBuscar.Close()
        cnConn.Close()


    End Sub
    Public Sub Insertar()
        Dim sql As String = "Insert Into Diesel (" & _
                            "IdTanque," & _
                            "NoCarga," & _
                            "Fecha," & _
                            "Hora," & _
                            "Cuentalitros," & _
                            "LitrosDisponibles," & _
                            "Kardex," & _
                            "Precio," & _
                            "LitrosSurtidos," & _
                            "IdAutobus," & _
                            "NoEconomico," & _
                            "IdRuta," & _
                            "NombreRuta," & _
                            "Litros," & _
                            "KilometrosTotales," & _
                            "KilometrosOperacion," & _
                            "KilometrosMuertos," & _
                            "RendimientoStandart," & _
                            "RendimientoAnterior," & _
                            "RendimientoDia," & _
                            "SubTotal," & _
                            "IVA," & _
                            "Total," & _
                            "CodigoOperador," & _
                            "NombreOperador," & _
                            "CodigoDespachador," & _
                            "NombreDespachador," & _
                            "ImporteEX01," & _
                            "ImporteEX02," & _
                            "ImporteEX03," & _
                            "ImporteEX04," & _
                            "ImporteEX05," & _
                            "TextoEX01," & _
                            "TextoEX02," & _
                            "TextoEX03," & _
                            "TextoEX04," & _
                            "TextoEX05) " & _
                            "VALUES (" & _
                            "@IdTanque," & _
                            "@NoCarga," & _
                            "@Fecha," & _
                            "@Hora," & _
                            "@Cuentalitros," & _
                            "@LitrosDisponibles," & _
                            "@Kardex," & _
                            "@Precio," & _
                            "@LitrosSurtidos," & _
                            "@IdAutobus," & _
                            "substring(@NoEconomico,1,50)," & _
                            "@IdRuta," & _
                            "substring(@NombreRuta,1,100)," & _
                            "@Litros," & _
                            "@KilometrosTotales," & _
                            "@KilometrosOperacion," & _
                            "@KilometrosMuertos," & _
                            "@RendimientoStandart," & _
                            "@RendimientoAnterior," & _
                            "@RendimientoDia," & _
                            "@SubTotal," & _
                            "@IVA," & _
                            "@Total," & _
                            "substring(@CodigoOperador,1,50)," & _
                            "substring(@NombreOperador,1,150)," & _
                            "substring(@CodigoDespachador,1,50)," & _
                            "substring(@NombreDespachador,1,150)," & _
                            "@ImporteEX01," & _
                            "@ImporteEX02," & _
                            "@ImporteEX03," & _
                            "@ImporteEX04," & _
                            "@ImporteEX05," & _
                            "substring(@TextoEX01,1,200)," & _
                            "substring(@TextoEX02,1,200)," & _
                            "substring(@TextoEX03,1,200)," & _
                            "substring(@TextoEX04,1,200)," & _
                            "substring(@TextoEX05,1,200))" & _
                            " SELECT SCOPE_IDENTITY()"

        Dim cnConn As New SqlConnection
        cnConn.ConnectionString = CitraConnection

        Dim Command As New SqlCommand(sql, cnConn)

        Command.Parameters.AddWithValue("IdTanque", mintIdTanque)
        Command.Parameters.AddWithValue("NoCarga", mintNoCarga)
        Command.Parameters.AddWithValue("Fecha", mdatFecha)
        Command.Parameters.AddWithValue("Hora", mtimHora)
        Command.Parameters.AddWithValue("Cuentalitros", mdblCuentalitros)
        Command.Parameters.AddWithValue("LitrosDisponibles", mdblLitrosDisponibles)
        Command.Parameters.AddWithValue("Kardex", mdblKardex)
        Command.Parameters.AddWithValue("Precio", mdblPrecio)
        Command.Parameters.AddWithValue("LitrosSurtidos", mdblLitrosSurtidos)
        Command.Parameters.AddWithValue("IdAutobus", mintIdAutobus)
        Command.Parameters.AddWithValue("NoEconomico", mstrNoEconomico)
        Command.Parameters.AddWithValue("IdRuta", mintIdRuta)
        Command.Parameters.AddWithValue("NombreRuta", mstrNombreRuta)
        Command.Parameters.AddWithValue("Litros", mdblLitros)
        Command.Parameters.AddWithValue("KilometrosTotales", mdblKilometrosTotales)
        Command.Parameters.AddWithValue("KilometrosOperacion", mdblKilometrosOperacion)
        Command.Parameters.AddWithValue("KilometrosMuertos", mdblKilometrosMuertos)
        Command.Parameters.AddWithValue("RendimientoStandart", mdblRendimientoStandart)
        Command.Parameters.AddWithValue("RendimientoAnterior", mdblRendimientoAnterior)
        Command.Parameters.AddWithValue("RendimientoDia", mdblRendimientoDia)
        Command.Parameters.AddWithValue("Subtotal", mdblSubtotal)
        Command.Parameters.AddWithValue("IVA", mdblIVA)
        Command.Parameters.AddWithValue("Total", mdblTotal)
        Command.Parameters.AddWithValue("CodigoOperador", mstrCodigoOperador)
        Command.Parameters.AddWithValue("NombreOperador", mstrNombreOperador)
        Command.Parameters.AddWithValue("CodigoDespachador", mstrCodigoDespachador)
        Command.Parameters.AddWithValue("NombreDespachador", mstrCodigoDespachador)
        Command.Parameters.AddWithValue("ImporteEX01", mdblImporte01)
        Command.Parameters.AddWithValue("ImporteEX02", mdblImporte02)
        Command.Parameters.AddWithValue("ImporteEX03", mdblImporte03)
        Command.Parameters.AddWithValue("ImporteEX04", mdblImporte04)
        Command.Parameters.AddWithValue("ImporteEX05", mdblImporte05)
        Command.Parameters.AddWithValue("TextoEX01", mstrTexto01)
        Command.Parameters.AddWithValue("TextoEX02", mstrTexto02)
        Command.Parameters.AddWithValue("TextoEX03", mstrTexto03)
        Command.Parameters.AddWithValue("TextoEX04", mstrTexto04)
        Command.Parameters.AddWithValue("TextoEX05", mstrTexto05)

        cnConn.Open()
        IdDiesel = Convert.ToInt32(Command.ExecuteScalar)

        If IdDiesel > 0 Then
            cnConn.Close()
        Else
            MsgBox("No fue posible insertar el registro ", MsgBoxStyle.Exclamation, "Aviso")
            If cnConn.State = ConnectionState.Open Then
                cnConn.Close()
            End If
        End If
    End Sub
    Public Sub Actualizar()

        Dim strSqlQry As String
        Dim cnConn As New SqlConnection

        cnConn.ConnectionString = CitraConnection
        strSqlQry = "Update Diesel Set " & _
                    "IdTanque=@IdTanque," & _
                    "NoCarga=@NoCarga," & _
                    "Fecha=@Fecha," & _
                    "Hora=@Hora," & _
                    "Cuentalitros=@Cuentalitros," & _
                    "LitrosDisponibles=@LitrosDisponibles," & _
                    "Kardex=@Kardex," & _
                    "Precio=@Precio," & _
                    "LitrosSurtidos=@LitrosSurtidos," & _
                    "IdAutobus=@IdAutobus," & _
                    "NoEconomico=substring(@NoEconomico,1,50)," & _
                    "IdRuta=@IdRuta," & _
                    "NombreRuta=substring(@NombreRuta,1,100)," & _
                    "Litros=@Litros," & _
                    "KilometrosTotales=@KilometrosTotales," & _
                    "KilometrosOperacion=@KilometrosOperacion," & _
                    "KilometrosMuertos=@KilometrosMuertos," & _
                    "RendimientoStandart=@RendimientoStandart," & _
                    "RendimientoAnterior=@RendimientoAnterior," & _
                    "RendimientoDia=@RendimientoDia," & _
                    "Subtotal=@Subtotal," & _
                    "IVA=@IVA," & _
                    "Total=@Total," & _
                    "CodigoOperador=substring(@CodigoOperador,1,50)," & _
                    "NombreOperador=substring(@NombreOperador,1,150)," & _
                    "CodigoDespachador=substring(@CodigoDespachador,1,50)," & _
                    "NombreDespachador=substring(@NombreDespachador,1,150)," & _
                    "ImporteEX01=@ImporteEX01," & _
                    "ImporteEX02=@ImporteEX02," & _
                    "ImporteEX03=@ImporteEX03," & _
                    "ImporteEX04=@ImporteEX04," & _
                    "ImporteEX05=@ImporteEX05," & _
                    "TextoEX01=substring(@TextoEX01,1,200)," & _
                    "TextoEX02=substring(@TextoEX02,1,200)," & _
                    "TextoEX03=substring(@TextoEX03,1,200)," & _
                    "TextoEX04=substring(@TextoEX04,1,200)," & _
                    "TextoEX05=substring(@TextoEX05,1,200) " & _
                    "Where IdDiesel=@IdDiesel"


        Dim Command As New SqlCommand(strSqlQry, cnConn)
        Command.Parameters.AddWithValue("IdDiesel", mintIdDiesel)
        Command.Parameters.AddWithValue("IdTanque", mintIdTanque)
        Command.Parameters.AddWithValue("NoCarga", mintNoCarga)
        Command.Parameters.AddWithValue("Fecha", mdatFecha)
        Command.Parameters.AddWithValue("Hora", mtimHora)
        Command.Parameters.AddWithValue("Cuentalitros", mdblCuentalitros)
        Command.Parameters.AddWithValue("LitrosDisponibles", mdblLitrosDisponibles)
        Command.Parameters.AddWithValue("Kardex", mdblKardex)
        Command.Parameters.AddWithValue("Precio", mdblPrecio)
        Command.Parameters.AddWithValue("LitrosSurtidos", mdblLitrosSurtidos)
        Command.Parameters.AddWithValue("IdAutobus", mintIdAutobus)
        Command.Parameters.AddWithValue("NoEconomico", mstrNoEconomico)
        Command.Parameters.AddWithValue("IdRuta", mintIdRuta)
        Command.Parameters.AddWithValue("NombreRuta", mstrNombreRuta)
        Command.Parameters.AddWithValue("Litros", mdblLitros)
        Command.Parameters.AddWithValue("KilometrosTotales", mdblKilometrosTotales)
        Command.Parameters.AddWithValue("KilometrosOperacion", mdblKilometrosOperacion)
        Command.Parameters.AddWithValue("KilometrosMuertos", mdblKilometrosMuertos)
        Command.Parameters.AddWithValue("RendimientoStandart", mdblRendimientoStandart)
        Command.Parameters.AddWithValue("RendimientoAnterior", mdblRendimientoAnterior)
        Command.Parameters.AddWithValue("RendimientoDia", mdblRendimientoDia)
        Command.Parameters.AddWithValue("Subtotal", mdblSubtotal)
        Command.Parameters.AddWithValue("IVA", mdblIVA)
        Command.Parameters.AddWithValue("Total", mdblTotal)
        Command.Parameters.AddWithValue("CodigoOperador", mstrCodigoOperador)
        Command.Parameters.AddWithValue("NombreOperador", mstrNombreOperador)
        Command.Parameters.AddWithValue("CodigoDespachador", mstrCodigoDespachador)
        Command.Parameters.AddWithValue("NombreDespachador", mstrCodigoDespachador)
        Command.Parameters.AddWithValue("ImporteEX01", mdblImporte01)
        Command.Parameters.AddWithValue("ImporteEX02", mdblImporte02)
        Command.Parameters.AddWithValue("ImporteEX03", mdblImporte03)
        Command.Parameters.AddWithValue("ImporteEX04", mdblImporte04)
        Command.Parameters.AddWithValue("ImporteEX05", mdblImporte05)
        Command.Parameters.AddWithValue("TextoEX01", mstrTexto01)
        Command.Parameters.AddWithValue("TextoEX02", mstrTexto02)
        Command.Parameters.AddWithValue("TextoEX03", mstrTexto03)
        Command.Parameters.AddWithValue("TextoEX04", mstrTexto04)
        Command.Parameters.AddWithValue("TextoEX05", mstrTexto05)
        cnConn.Open()

        Dim RowsAffected As Integer = Command.ExecuteNonQuery

        If RowsAffected > 0 Then
            cnConn.Close()
        Else
            MsgBox("No fue posible actualizar el liquidación ", MsgBoxStyle.Exclamation, "Aviso")
            If cnConn.State = ConnectionState.Open Then
                cnConn.Close()
            End If
        End If



    End Sub
End Class
